require(["jquery",'public','weui'],function($,public,weui) {
    public.header();
    var shopmall = public.getUrlParam('shopmall'); // 1:县会长  2:一带一路
    if(shopmall == 1){
        public.footer(2);
    }else{
        public.footer(3);       
    }
    var shop_id = public.getUrlParam('id');
    public.allocator();

    function getData(shop_id){
    	$.ajax({
            type: 'post',
            async: false,
            dataType: 'json',
            data: {id: shop_id},
            url: MODULE+'Shopmall/more_goods',           
        }).success(function (res) {
            console.log(res);
            if(res.code == 1){
                $.alert(res.msg);
                return false;
            }
            if(!res.data_user_goods || !res.data_user_goods.length){
            	return false;
            }
            var str = '';
            res.data_user_goods.forEach(function(i){
	            str += '<li class="shop_product_item">'
					+		'<a class="shop_product_link" href="'+MODULE+'PublicJump/productInfo/id/'+i.goods_id+'">'
					+			'<div class="shop_product_picture"><img src="'+PUBLIC+i.goods_picture_path+'" alt=""></div>'
					+			'<p class="shop_product_detail">'+i.goods_name+'</p>'
					+			'<p class="shop_product_price">￥'+i.goods_price+'</p>'
					+		'</a>'
					+	'</li>'
            });
            $('.shop_product_list').append(str);
            $('.shop_picture img').attr('src',PUBLIC+res.data_get_user_one_info.user_picture_path);
            $('.shop_name').text(res.data_get_user_one_info.user_username);
            
        }).fail(function (jqXHR, textStatus, errorThrown) {});
    }

    getData(shop_id);

    //页面加载完毕
    public.loaded();
})